import { request } from '@/api/request';
import { APISAFEINDEX } from '@/common';

type RormulaDetailType = {
  formulaName?: string;
  timeUnit?: string;
  maximumScore?: number;
  minimumScore?: number;
  maxCycle?: number;
  occurrencesNumber?: number;
  numerator?: number;
  denominator?: number;
  signBit?: string;
  variableMinimumValue?: number;
  variableMaximumValue?: number;
};
/**
 * @desc 公式查询
 */
export const getFormulaDetail = (params: { factorId: string }) =>
  request<RormulaDetailType>({
    method: 'get',
    url: `${APISAFEINDEX}safetyfactorformulasettings/detail`,
    params,
  });

export const saveFormulaSet = (data: any) =>
  request({
    url: `${APISAFEINDEX}safetyfactorformulasettings/saveSafetyfactorformulasettings`,
    data,
  });
